<template>
	<view class="content">
		<view class="content-item">
			<view v-for="(item,index) in list" class="item f-c-b f30" @click="$to(`../index_commodityclassification-detail/index_commodityclassification-detail?title=${item.name}&parentId=${item.id}`)">
				<view class="item-left" >
					<view class="">{{item.name}}</view>
					<image src="../../static/index-cate/icon_y.png" mode="widthFix"></image>
				</view>
				<view class="item-right">
					<image :src="$u.baseUrl+item.cimg" mode="widthFix"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: []
			}
		},
		onLoad() {
			this.TopClassify()
		},
		methods: {
			async TopClassify(){
				const {data,msg,success}=await this.$u.api.TopClassify()
				if(!success){
					this.$u.toast(msg)
					return
				}
				this.list=data
			}
		}
	}
</script>

<style>
	.content {
		background-color: #F6F6F6;
		height: 100vh;
		
	}
	.content-item{
		display: flex;
		flex-wrap: wrap;
		justify-content: space-between;
		padding: 20rpx;
	}
	.item{
		width: 210rpx;
		height: 105rpx;
		background-color: #FFFFFF;
		border-radius: 10rpx;
		margin-bottom: 20rpx;
	}
	.item-left{
		display: flex;
		flex-direction: column;
		align-items: center;
		padding-left: 20rpx;
	}
	.item-left image{
		width: 20rpx;		
		margin-top: 10rpx;
	}
	.item-right{
		width: 83rpx;
		height: 100%;
	}
	.item-right image{
		width: 100%;
	}
</style>
